//
//  MqMainBrandHeadTableView.m
//  Meiqi
//
//  Created by lanou on 16/1/12.
//  Copyright © 2016年 KFC. All rights reserved.
//

#import "MqMainBrandHeadTableView.h"

@implementation MqMainBrandHeadTableView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        CGFloat height = frame.size.height;
        CGFloat width = frame.size.width;
        
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 30, height /2 - 20)];
        imageView.image = [UIImage imageNamed:@"hot"];
        [self addSubview:imageView];
        
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(50, 0, width - 50, height / 2)];
        label.text = @"热门品牌:";
        
        [self addSubview:label];
        
        for (int i = 0; i < 4; i ++) {
            
            UIButton *button = [UIButton buttonWithType:(UIButtonTypeCustom)];
            button.frame = CGRectMake(10 + ((width - 100) / 4 + 20) * i, height / 2, (width - 100) / 4, height / 2 - 10);
            [button setTitleColor:[UIColor blackColor] forState:(UIControlStateNormal)];
        
            button.tag = 10 + i;
            //button.backgroundColor = [UIColor colorWithRed:220 green:220 blue:220 alpha:1];
            [self addSubview:button];
        }
    }
    return self;
}



@end
